﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"
    CodeBehind="Product.aspx.cs" Inherits="Administration.Product" %>

<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="CKEditor" Namespace="CKEditor.NET" Assembly="CKEditor.NET, Version=3.6.4.0, Culture=neutral, PublicKeyToken=e379cdf2f8354999" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="shell">
        <!-- Message box -->
        <div id="msgBox" runat="server">
        </div>
        <!-- End Message box -->
        <!-- Main -->
        <div id="main">
            <div class="cl">
                &nbsp;</div>
            <!-- Content -->
            <div id="fullContent">
                <!-- Box -->
                <div class="box">
                    <!-- Box Head -->
                    <div class="box-head">
                        <h2>
                            Sản phẩm</h2>
                    </div>
                    <!-- End Box Head -->
                    <!-- Search Box-->
                    <div class="boxSearch">
                        <input id="activeSearch" type="button" value="Tìm kiếm" class="activeSearch" />
                        <div id="contentSearch">
                            <table style="width: 100%;">
                                <tr>
                                    <td class="style1">
                                        Sản phẩm
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtName" runat="server" Width="281px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style1">
                                        Loại xe
                                    </td>
                                    <td>
                                        <telerik:RadComboBox ID="rcbchildrenCategory" runat="server">
                                        </telerik:RadComboBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style1">
                                        <telerik:RadButton ID="btnSearch" OnClick="btnSearch_Click" CssClass="btnSearch"
                                            Text="Tìm kiếm" runat="server">
                                        </telerik:RadButton>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                            <asp:HiddenField runat="server" ID="hdfActiveSearch" Value="0"></asp:HiddenField>
                        </div>
                        <div class="cl">
                        </div>
                    </div>
                    <!-- End Search Box-->
                    <telerik:RadGrid ID="grid" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                        DataMember="Id" GridLines="None" OnDeleteCommand="grid_DeleteCommand" OnNeedDataSource="grid_NeedDataSource"
                        OnInsertCommand="grid_InsertCommand" OnItemDataBound="grid_ItemDataBound" OnUpdateCommand="grid_UpdateCommand">
                        <MasterTableView DataMember="Id" NoMasterRecordsText="Chưa có sản phẩm nào" CommandItemDisplay="Bottom"
                            DataKeyNames="Id" PageSize="15">
                            <CommandItemSettings AddNewRecordText="Thêm mới sản phẩm" RefreshText=""></CommandItemSettings>
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                            </ExpandCollapseColumn>
                            <Columns>                                
                                <telerik:GridTemplateColumn HeaderText="Sản Phẩm">
                                    <ItemTemplate>
                                        <asp:Label ID="lblName" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>                                       
                                        <telerik:RadTextBox ID="txtName" runat="server" Text='<%# Eval("Name") %>' Width="800px"></telerik:RadTextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName" Text="(Bắt buộc nhập)" BorderColor="Red"></asp:RequiredFieldValidator>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>                                
                                <telerik:GridTemplateColumn HeaderText="Giá xe">
                                    <ItemTemplate>
                                        <asp:Label ID="lblPrice" runat="server" Text='<%# Eval("Price") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>                                       
                                        <telerik:RadTextBox ID="txtPrice" runat="server" Text='<%# Eval("Price") %>' Width="800px"></telerik:RadTextBox>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>                                
                                <telerik:GridTemplateColumn HeaderText="Hotline">
                                    <ItemTemplate>
                                        <asp:Label ID="lblHotline" runat="server" Text='<%# Eval("Hotline") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>                                       
                                        <telerik:RadTextBox ID="txtHotline" runat="server" Text='<%# Eval("Hotline") %>' Width="800px"></telerik:RadTextBox>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Loại xe">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="categoryName" Text='<%# Eval("CategoryName") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <telerik:RadComboBox runat="server" ID="ddlCategory">
                                        </telerik:RadComboBox>
                                        <asp:HiddenField ID="categoryId" runat="server" Value='<%# Eval("categoryId") %>' />
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridCheckBoxColumn DataField="ShowInNews" DataType="System.Boolean" FilterControlAltText="Filter column column"
                                    HeaderText="Hiển thị ở <br> tin tức" UniqueName="columnName1">
                                </telerik:GridCheckBoxColumn>
                                <telerik:GridCheckBoxColumn DataField="ShowInConsultServices" DataType="System.Boolean"
                                    FilterControlAltText="Filter column column" HeaderText="Hiển thị ở <br> tư vấn - dịch vụ"
                                    UniqueName="columnName2">
                                </telerik:GridCheckBoxColumn>
                                <telerik:GridCheckBoxColumn DataField="ShowInPayment" DataType="System.Boolean" FilterControlAltText="Filter column column"
                                    HeaderText="Hiển thị ở <br> phương thức thanh toán" UniqueName="columnName3">
                                </telerik:GridCheckBoxColumn>
                                <telerik:GridCheckBoxColumn DataField="ShowInHomePage" FilterControlAltText="Filter column column"
                                    HeaderText="Hiểnt thị ở <br>trang chủ" UniqueName="columnName4">
                                </telerik:GridCheckBoxColumn>
                                <telerik:GridTemplateColumn HeaderText="Chi tiết sản phẩm" Display="False">                                    
                                    <EditItemTemplate>                                        
                                        <CKEditor:CKEditorControl ID="editDescription" runat="server" Text='<%# Eval("Description") %>'
                                        Language="vi"></CKEditor:CKEditorControl>                                        
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Hình đại diện" UniqueName="Upload" Display="False">
                                    <EditItemTemplate>
                                        <telerik:RadUpload ID="uploadAvatar" runat="server" Skin="Office2007" InitialFileInputsCount="1"
                                            MaxFileInputsCount="1" ControlObjectsVisibility="None" MaxFileSize="0" AllowedFileExtensions=".jpg,.png,.bmp,.gif">
                                        </telerik:RadUpload>
                                        <asp:HiddenField runat="server" ID="hdfImage" Value='<%# Eval("Image") %>' />
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>                                
                                <telerik:GridTemplateColumn HeaderText="Diễn giải ảnh" Display ="false">
                                    <EditItemTemplate>                                       
                                        <telerik:RadTextBox ID="txtTitleOfImage" runat="server" Text='<%# Eval("TitleOfImage") %>' Width="800px"></telerik:RadTextBox>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Sản phẩm liên quan" Display="False">
                                    <EditItemTemplate>
                                        <telerik:RadListBox ID="ListBoxFunctions" runat="server" AllowTransferDuplicates="false"
                                            TransferMode="Move" AllowTransfer="true" TransferToID="ListBoxFunctionUpdate"
                                            DataKeyField="Id" DataMember="Id" DataTextField="Name" Height="300px" Width="300px"
                                            Skin="Office2007" Style="float: left;">
                                        </telerik:RadListBox>
                                        <telerik:RadListBox Skin="Office2007" ID="ListBoxFunctionUpdate" runat="server" Height="300px"
                                            Width="300px" AllowDelete="false" DataKeyField="Id" DataMember="Id" DataTextField="Name"
                                            DataValueField="Id">
                                        </telerik:RadListBox>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="SEO:Tiêu đề" Display="False">                                    
                                    <EditItemTemplate>                                       
                                        <telerik:RadTextBox ID="txtSEO_Title" runat="server" Text='<%# Eval("SEO_Title") %>' Width="800px"></telerik:RadTextBox>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                 <telerik:GridTemplateColumn HeaderText="SEO:Keyword" Display="False">                                    
                                    <EditItemTemplate>                                       
                                        <telerik:RadTextBox ID="txtSEO_Keyword" runat="server" Text='<%# Eval("SEO_Keyword") %>' Width="800px"></telerik:RadTextBox>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                 <telerik:GridTemplateColumn HeaderText="SEO:Mô tả" Display="False">                                    
                                    <EditItemTemplate>                                       
                                        <telerik:RadTextBox ID="txtSEO_Description" runat="server" Text='<%# Eval("SEO_Description") %>' Width="800px"></telerik:RadTextBox>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridEditCommandColumn UpdateText="Cập nhật" EditText="Cập nhật" ButtonType="ImageButton" />
                                <telerik:GridButtonColumn CommandName="Delete" Text="Xóa" UniqueName="columnDelete"
                                    ButtonType="ImageButton" ConfirmText="Bạn muốn xóa sản phẩm này ?">
                                </telerik:GridButtonColumn>
                            </Columns>
                            <EditFormSettings>
                                <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"
                                    ButtonType="ImageButton" CancelText="Hủy" EditText="Cập nhật" HeaderButtonType="None"
                                    InsertText="Thêm mới" UpdateText="Cập nhật">
                                </EditColumn>
                            </EditFormSettings>
                            <PagerStyle FirstPageToolTip="Trang đầu" LastPageToolTip="Trang cuối" NextPagesToolTip="Trang tiếp"
                                NextPageToolTip="Trang tiếp" PageSizeLabelText="Số dòng trên một trang:" PrevPagesToolTip="Trang trước"
                                PrevPageToolTip="Trang trước" 
                                PagerTextFormat="Change page: {4} &amp;nbsp;Trang {0} trong {1} trang, từ dòng {2} đến dòng {3} trong {5} dòng" />
                        </MasterTableView>
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                        </HeaderContextMenu>
                    </telerik:RadGrid>
                </div>
                <!-- End Box -->
            </div>
            <!-- End Content -->
            <div class="cl">
                &nbsp;</div>
        </div>
        <!-- Main -->
    </div>
</asp:Content>
